"""
Air transitions from 
http://www.pa.uky.edu/~peter/atomic/ 
http://physics.nist.gov/PhysRefData/ASD/lines_form.html
Created on Oct 5, 2009
@author: aamn
"""
# might be smart to change waves into N and D, where each are 3 element
# lists of lo,hi,weight and a check that the number of lists in N is gt
# than 1 means there are more than 1 samplings of the bandpass.
# #
# provenance gives the origin of the spectral *index* not the line itself.
# 2007AJ....134.2398C  (Covey et al.,  SED Locus & Hammer Appendix)
# 2002AJ....123.3409H  (Hawley et al., MLT in SDSS)
# 1999ApJ...519..802K  (Kirkpatrick et al., "L type")
# 1995AJ....109.1379A  (Allen & Strom, Spectral Standards)
# 1995AJ....110.1838R  (Reid et al., psmu northern m dwarfs)
# 1993PASP..105..693T  (Torres-Dodgen & Weaver, nir spec normal stars)
# 1991ApJS...77..417K  (Kirkpatrick et al., "spectral seq in red")
# 1985ApJS...59...33P  (Pickles, Spectrophotometric atlas) 

# new lines? CaIIt2, K1, [He6678, Li] 
# assume same style as Covey; line in numerator.
#
indices = {\
#				"CaIIH":{"air":[3968.0, ],
#							"N":[3923.7, 3943.7, 1.],
#							"D":[3943.7, 3953.7, 1.],
#							"type":0,
#							"title":ur"Ca \u0399\u0399 \"K\"",
#							"dictindex":0,
#							"provenance":[""]},
				"CaII85":{"air":[8542.09, ],
								"N":[[8527., 8557., 1.]],
								"D":[[8565., 8585., 1.]],
								"type":0,
								"title":ur"Ca \u0399\u0399 \u03BB8542",
								"dictindex":-1,
								"provenance":["2007AJ....134.2398C", "1995AJ....109.1379A",
														"1991ApJS...77..417K"]},

				"KI7665 ":{"air":[7664.90, 7698.96, ],
							"N":[[7659., 7705., 1.]],
							"D":[[7960.0, 8000.0, 1.]],
							"type":0,
							"title":ur"K \u0399 \u03BB7665,7699",
							"dictindex":-1,
							"provenance":[""]},
#
#				" ":{"air":[0.0,],
#							"N":[, 1.],
#							"D":[, 1.],
#							"type":0,
#							"title":ur"X \u0399\u0399 \u03BB",
#							"dictindex":-1,
#							"provenance":[""]},
	}


def lines(indices):
	lines = {}
	lineskeys = ['air', 'title']
	for foo in indices.keys():
		lines[foo] = dict([(bah, indices[foo][bah]) for bah in lineskeys])
